package models

type Article struct {
	ID
	Title   string `gorm:"not null;unique_index"`
	Desc    string `gorm:"type:text"`
	Content string `gorm:"type:text"`
	Img     string `gorm:"type:text"`
	Status  int    `gorm:"default:1"`

	//文章类型
	Type string

	//关联的游戏id
	GameId string

	Timestamps
	SoftDeletes

	//表不显示的评论list
	CommentList []ArticleComment `gorm:"-"`
}

// 文章评论  可以回复的评论   评论的评论
type ArticleComment struct {
	ID
	Content   string `gorm:"type:text;not null"`
	UserId    uint   `gorm:"not null"`
	ArticleId uint   `gorm:"not null"`
	ParentId  uint   `gorm:"default:0"`

	Timestamps
	SoftDeletes

	//表不显示的评论list
	CommentList []ArticleComment `gorm:"-"`
}
